package com.itheima_01;

/**
 * @author Xiao
 * @date 2021/7/4
 */
/*
    遍历二维数组：
        已知一个二维数组arr ={ {11,22,33},{433,44,55} };遍历该数组，取出所有元素并打印。
 */
public class PrintArray {
    public static void main(String[] args) {
        int[][] arr = {{11, 22, 33}, {33, 44, 55}};
        System.out.print("{");
        for (int i = 0; i < arr.length; i++) {
            System.out.print("{");
            for (int i1 = 0; i1 < arr[i].length; i1++) {
                if (i1 == arr[i].length - 1) {
                    System.out.print(arr[i][i1]);
                } else {
                    System.out.print(arr[i][i1] + ",  ");
                }
            }
            System.out.print("},");
        }
        System.out.println("}");
    }
}
